package br.com.poc.pitagorasnumero.tests.domain;

import org.junit.Test;
import org.junit.runner.RunWith;

import br.com.poc.pitagorasnumero.tests.runner.RunnerTest;
import br.com.poc.pitagorasnumero.type.TablePitagoricaType;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

@RunWith(RunnerTest.class)
public class TabelaPitagoricaDomainTest {

	@Test
	public void testGetValorLetraSucesso1() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("A");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_1));

	}

	@Test
	public void testGetValorLetraSucesso2() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("K");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_2));
	}

	@Test
	public void testGetValorLetraSucesso3() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("U");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_3));
	}

	@Test
	public void testGetValorLetraSucesso4() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("D");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_4));
	}

	@Test
	public void testGetValorLetraSucesso5() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("N");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_5));
	}

	@Test
	public void testGetValorLetraSucesso6() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("X");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_6));
	}

	@Test
	public void testGetValorLetraSucesso7() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("G");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_7));
	}

	@Test
	public void testGetValorLetraSucesso8() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("Q");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_8));
	}

	@Test
	public void testGetValorLetraSucesso9() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("R");

		assertThat(domain, equalTo(TablePitagoricaType.VALUE_9));
	}

	@Test
	public void testGetValorLetraError1() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter("WE");

		assertThat(domain, equalTo(TablePitagoricaType.ERROR));
	}

	@Test
	public void testGetValorLetraError2() {

		TablePitagoricaType domain = TablePitagoricaType
				.getValueLetter(String.valueOf(1));

		assertThat(domain, equalTo(TablePitagoricaType.ERROR));
	}

}
